﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;

namespace BSC
{
    public partial class _Default : System.Web.UI.Page
    {
        void CostImport()
        {
            DesktopModule dskM = new DesktopModule();
            dskM.ModuleID = "modCostImport";
            dskM.WindowID = "winCostImport";
            dskM.AutoRun = false;
            dskM.Launcher.ID = "costImportLauncher";
            dskM.Launcher.Text = "Nhập chi phí";
            dskM.Launcher.Icon = Icon.CoinsAdd;
            DesktopShortcut dskS = new DesktopShortcut();
            dskS.ModuleID = "modCostImport";
            dskS.Text = "Nhập chi phí";
            dskS.IconCls = "shortcut-icon icon-cost-import";
            MyDesktop.Modules.Add(dskM);
            MyDesktop.Shortcuts.Add(dskS);
        }
        void RevImport()
        {
            DesktopModule dskM = new DesktopModule();
            dskM.ModuleID = "modCostImport";
            dskM.WindowID = "winCostImport";
            dskM.AutoRun = false;
            dskM.Launcher.ID = "costImportLauncher";
            dskM.Launcher.Text = "Nhập chi phí";
            dskM.Launcher.Icon = Icon.CoinsAdd;
            DesktopShortcut dskS = new DesktopShortcut();
            dskS.ModuleID = "modCostImport";
            dskS.Text = "Nhập chi phí";
            dskS.IconCls = "shortcut-icon icon-cost-import";
            MyDesktop.Modules.Add(dskM);
            MyDesktop.Shortcuts.Add(dskS);
        }
        void LoadWindow(string id, string title, string cls)
        {
            DesktopModule dskM = new DesktopModule();
            dskM.ModuleID = "mod"+id;
            dskM.WindowID = "win"+id;
            dskM.AutoRun = false;
            dskM.Launcher.ID = id+"Launcher";
            dskM.Launcher.Text = title;
            dskM.Launcher.Icon = Icon.CoinsAdd;
            DesktopShortcut dskS = new DesktopShortcut();
            dskS.ModuleID = "mod"+id;
            dskS.Text = title;
            dskS.IconCls = "shortcut-icon icon-"+cls;
            MyDesktop.Modules.Add(dskM);
            MyDesktop.Shortcuts.Add(dskS);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["user_code"] == null || Session["user_code"] == "")
            {
                Response.Redirect("login.aspx");
            }
            this.ResourceManager1.Theme = ThemeControl.Theme;
            LoadWindow("CostImport","Nhập chi phí","cost-import");
            LoadWindow("RevImport", "Nhập doanh thu", "cost-import");
        }
    }
}
